﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Web.UI.WebControls;

using BusinessManagementStudio.Models.BusinessObject.Entities;
using BusinessManagementStudio.Models.BusinessObject.Reports;
using BusinessManagementStudio.Utilities;

namespace BusinessManagementStudio.ViewModel
{
    public class ReportView
    {
        public IEnumerable<SelectListItem> ReportTypeList { get; set; }
        public List<IData> InvoiceList { get; set; }
        public List<QData> QuotationList { get; set; }
        public List<WOData> WorkOrderList { get; set; }

        public ReportView()
        {
            ReportTypeList = GetReportTypeNameList();
        }

        private IEnumerable<SelectListItem> GetReportTypeNameList()
        {
            return GetReportTypeList();
        }

        private List<SelectListItem> GetReportTypeList()
        {
            List<SelectListItem> rptTypeList = new List<SelectListItem>();

            List<String> AllReportTypesList = Configuration.ReportTypeList;

            foreach (String rptype in AllReportTypesList)
            {
                SelectListItem sListItem = new SelectListItem();
                sListItem.Text = rptype;
                sListItem.Value = rptype;

                rptTypeList.Add(sListItem);
            }

            return rptTypeList;
        }
    }
}